package org.ypx.center.controller.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.ypx.center.controller.UserInfoController;
import org.ypx.center.service.IUserInfoService;
import org.ypx.db.entity.User;
import org.ypx.db.entity.UserInfo;
import org.ypx.db.entity.UserRole;
import org.ypx.shared.common.Result;
import org.ypx.shared.service.vo.UserInfoVO;

import java.util.List;

/**
 * @author tingwen
 * @date 2017/3/28 21:06
 * @description
 */
@Controller
@RequestMapping("userInfo")
public class UserInfoControllerImpl extends BaseControllerImpl<UserInfo> implements UserInfoController {
    @Autowired
    private IUserInfoService userInfoService;

    @RequestMapping("saveInfo.do")
    @ResponseBody
    @Override
    public Result<List<UserInfo>> saveUserInfo(UserInfo entity, User user, UserRole userRole) {
        return userInfoService.saveUserInfo(entity, user, userRole);
    }

    @RequestMapping("selectInfo.do")
    @ResponseBody
    @Override
    public Result<List<UserInfoVO>> selectInfo(UserInfo entity, User user, UserRole userRole) {
        Result<List<UserInfoVO>> result = userInfoService.selectUserInfo(entity, user, userRole);
        return result;
    }



}
